package com.woniuxy.micromemberserver.service;

import com.github.pagehelper.PageInfo;
import com.woniuxy.micromemberserver.bean.MemberTypeBean;
import com.woniuxy.micromemberserver.bean.PageRequest;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * 会员类型Service
 * @Author hz
 */
@Transactional(readOnly = true)
public interface IMemberTypeService {

    /**
     * 条件分页查询
     * @param request 分页请求
     * @param memberTypeBean 会员类型实体
     * @return
     */
    @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
    PageInfo<MemberTypeBean> findAllByParams(PageRequest request, MemberTypeBean memberTypeBean);

    /**
     * 新增会员类型
     * @param memberTypeBean
     * @return
     */
    @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
    int saveMemberType(MemberTypeBean memberTypeBean);

    /**
     * 修改会员类型（或删除：仅修改删除标记）
     * @param memberTypeBean
     * @return
     */
    @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
    int updateMemberType(MemberTypeBean memberTypeBean);
}
